// 定义图形抽象类
import 'dart:ui';

abstract class RandomShape {
  Offset position;
  double speedX;
  double speedY;
  Color color;
  bool isVisible;
  int visibleDuration;
  int invisibleDuration;
  int elapsedTime;

  RandomShape({
    required this.position,
    required this.speedX,
    required this.speedY,
    required this.color,
    this.isVisible = true,
    this.visibleDuration = 2000,
    this.invisibleDuration = 1000,
    this.elapsedTime = 0,
  });

  void move(Size size);

  void draw(Canvas canvas, Size size);

  void updateVisibility(Size size);

  bool isOutOfBounds(Size size);

  void resetPosition(Size size);
}
